#include <stdio.h>

int main() {
    long long a, b;
    scanf_s("%lld%lld", &a, &b);
    int i = 1;
    int temp;

    long long m = a, n = b;
    while (a % b)
    {
        temp = a % b;
        a = b;
        b = temp;
    }
    printf("%lld", (m * n) / b + b);
    return 0;
}